/* © 2020-2025 ALYR.NET */
/* 移动端样式 - 与PC端保持一致的设计风格 */

/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* 移动端容器布局 */
.container {
    padding: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 移动端头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 14px;
    border-radius: 20px;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn {
    color: white;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logout-btn:active {
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(255, 107, 107, 0.4);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ff5252;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.header p {
    font-size: 14px;
    color: #7f8c8d;
}

/* 移动端新窗口按钮 - 隐藏 */
.open-new-window-btn {
    display: none; /* 隐藏无法截图上传按钮 */
}

/* 移动端功能列表 */
.features-list {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 5px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    flex: 0 0 auto;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

.feature-item:active {
    background: rgba(52, 152, 219, 0.1);
    transform: scale(0.98);
}

.feature-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

/* 移动端tooltip优化 */
.feature-desc {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2c3e50;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    width: 280px;
    max-width: 90vw;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: fadeIn 0.2s ease;
}

.feature-item:active .feature-desc {
    display: block;
}

/* 移动端主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
}

.main-content.has-files {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 移动端上传区域 */
.upload-area {
    background: #fff;
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 200px;
}

.main-content.has-files .upload-area {
    display: none;
}

.upload-area:active {
    border-color: #2980b9;
    background: #f8f9fa;
    transform: scale(0.98);
}

.upload-area.dragover {
    border-color: #27ae60;
    background: #e8f5e8;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #3498db;
}

.upload-text {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
    text-align: center;
}

.upload-hint {
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.5;
    margin-bottom: 8px;
    text-align: center;
}

.upload-limit {
    font-size: 11px;
    color: #e74c3c;
    font-weight: 500;
    background: rgba(231, 76, 60, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(231, 76, 60, 0.2);
    text-align: center;
}

/* 移动端文件输入样式 */
.file-input {
    display: none;
}

/* 美化的选择文件按钮 */
.upload-area::after {
    content: "选择文件";
    display: inline-block;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.upload-area:active::after {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

/* 移动端批量上传 */
.batch-upload {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.batch-upload h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

/* 移动端文件列表 */
.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
    -webkit-overflow-scrolling: touch;
}

.file-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    position: relative;
    text-align: center;
}

.file-item:active {
    transform: scale(0.98);
    background: #e9ecef;
}

.file-preview {
    width: 100%;
    height: 80px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f8f9fa;
}

.file-icon {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 8px;
}

.file-info {
    width: 100%;
}

.file-name {
    font-size: 12px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
    word-wrap: break-word;
    word-break: break-all;
    white-space: normal;
    line-height: 1.3;
    max-height: 3.9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.file-size {
    font-size: 11px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.file-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.file-remove,
.remove-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    z-index: 10;
}

.file-remove:active,
.remove-btn:active {
    background: #c0392b;
    transform: scale(0.95);
}

/* 移动端结果区域 */
.results-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.results-section {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.results-header {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #7f8c8d;
    height: 100%;
}

.placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.placeholder-text {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #34495e;
}

.placeholder-hint {
    font-size: 12px;
    opacity: 0.7;
}

/* 移动端结果卡片 */
.result-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fff;
    transition: all 0.2s ease;
}

.result-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.result-card.safe {
    border-left: 4px solid #27ae60;
}

.result-card.warning {
    border-left: 4px solid #f39c12;
}

.result-card.danger {
    border-left: 4px solid #e74c3c;
}

.result-image-container {
    width: 100%;
    height: 150px;
    margin-bottom: 12px;
    position: relative;
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
}

.result-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    word-break: break-all;
    border: 1px solid #e9ecef;
    padding: 8px;
    border-radius: 6px;
    background: #f8f9fa;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    margin-bottom: 8px;
}

.status-icon {
    font-size: 14px;
}

.status-text {
    font-size: 13px;
}

.result-details {
    margin-top: 10px;
}

.result-details h5 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 13px;
    font-weight: 600;
}

.detection-info,
.logo-details {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
}

.logo-no-result {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.info-item {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 500;
    color: #666;
    min-width: 40px;
    font-size: 12px;
}

.info-value {
    flex: 1;
    font-size: 12px;
    color: #333;
}

.confidence-info {
    margin-top: 8px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
}

.confidence-label {
    color: #666;
    margin-right: 4px;
}

.confidence-value {
    font-weight: 600;
    color: #2c3e50;
}

/* 移动端统计卡片 */
.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:active {
    transform: scale(0.98);
    background: #e9ecef;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 移动端模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 350px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.modal-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #3498db;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

.modal-message {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:active {
    background: #2980b9;
    transform: scale(0.98);
}

/* 移动端按钮样式 */
.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:active {
    background: #2980b9;
    transform: scale(0.98);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:active {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:active {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:active {
    background: #c0392b;
}

/* 移动端状态样式 */
.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-analyzing {
    background: #cce5ff;
    color: #004085;
}

.status-safe {
    background: #d4edda;
    color: #155724;
}

.status-unsafe {
    background: #f8d7da;
    color: #721c24;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-logo-detected {
    background: #d5f4e6;
    color: #27ae60;
}

.status-no-logo {
    background: #fdeaea;
    color: #e74c3c;
}

/* 移动端加载动画 */
.loading {
    text-align: center;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    color: #7f8c8d;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 移动端动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 移动端滚动条优化 */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 2px;
    transition: all 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 移动端安全区域适配 */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}

/* 移动端性能优化 */
.upload-area,
.file-item,
.result-card,
.stat-card,
.modal-content {
    will-change: transform;
    backface-visibility: hidden;
}

/* 移动端无障碍优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 移动端横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        padding: 10px;
        gap: 10px;
    }
    
    .header {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .upload-area {
        min-height: 120px;
        padding: 20px 15px;
    }
    
    .upload-icon {
        font-size: 32px;
        margin-bottom: 8px;
    }
}